/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author usuario
 */
@Entity
@Table(name = "boleta")
@NamedQueries({
    @NamedQuery(name = "Boleta.findAll", query = "SELECT b FROM Boleta b"),
    @NamedQuery(name = "Boleta.findByIdBoleteria", query = "SELECT b FROM Boleta b WHERE b.idBoleteria = :idBoleteria"),
    @NamedQuery(name = "Boleta.findByEstado", query = "SELECT b FROM Boleta b WHERE b.estado = :estado"),
    @NamedQuery(name = "Boleta.findByFechaIngreso", query = "SELECT b FROM Boleta b WHERE b.fechaIngreso = :fechaIngreso"),
    @NamedQuery(name = "Boleta.findByHoraIngreso", query = "SELECT b FROM Boleta b WHERE b.horaIngreso = :horaIngreso"),
    @NamedQuery(name = "Boleta.findByTipo", query = "SELECT b FROM Boleta b WHERE b.tipo = :tipo"),
    @NamedQuery(name = "Boleta.findByCosto", query = "SELECT b FROM Boleta b WHERE b.costo = :costo")})
public class Boleta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idBoleteria")
    private Integer idBoleteria;
    @Size(max = 45)
    @Column(name = "Estado")
    private String estado;
    @Column(name = "FechaIngreso")
    @Temporal(TemporalType.DATE)
    private Date fechaIngreso;
    @Column(name = "HoraIngreso")
    @Temporal(TemporalType.TIME)
    private Date horaIngreso;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Tipo")
    private String tipo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "Costo")
    private int costo;
    @JoinColumn(name = "Competencia_idCompetencia", referencedColumnName = "idCompetencia")
    @ManyToOne(optional = false)
    private Competencia competencia;

    public Boleta() {
    }

    public Boleta(Integer idBoleteria) {
        this.idBoleteria = idBoleteria;
    }

    public Boleta(Integer idBoleteria, String tipo, int costo) {
        this.idBoleteria = idBoleteria;
        this.tipo = tipo;
        this.costo = costo;
    }

    public Integer getIdBoleteria() {
        return idBoleteria;
    }

    public void setIdBoleteria(Integer idBoleteria) {
        this.idBoleteria = idBoleteria;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public Date getFechaIngreso() {
        return fechaIngreso;
    }

    public void setFechaIngreso(Date fechaIngreso) {
        this.fechaIngreso = fechaIngreso;
    }

    public Date getHoraIngreso() {
        return horaIngreso;
    }

    public void setHoraIngreso(Date horaIngreso) {
        this.horaIngreso = horaIngreso;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public int getCosto() {
        return costo;
    }

    public void setCosto(int costo) {
        this.costo = costo;
    }

    public Competencia getCompetencia() {
        return competencia;
    }

    public void setCompetencia(Competencia competencia) {
        this.competencia = competencia;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idBoleteria != null ? idBoleteria.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boleta)) {
            return false;
        }
        Boleta other = (Boleta) object;
        if ((this.idBoleteria == null && other.idBoleteria != null) || (this.idBoleteria != null && !this.idBoleteria.equals(other.idBoleteria))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Boleta[ idBoleteria=" + idBoleteria + " ]";
    }
    
}
